import 'dart:async';
import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:top_foundation/top_foundation.dart';
import '../utils/theme/theme.dart';
import '../utils/util.dart';

part 'menu_item.dart';
part 'appbar.dart';
part 'search_bar.dart';
part 'title_content_view.dart';
part 'button.dart';
part 'selected_tag_view.dart';
part 'red.dart';
part 'frame_image.dart';
part 'radio.dart';
part 'toggle.dart';

part 'border.dart';
part 'column.dart';

part './text_field/code_field.dart';
part './text_field/text_field.dart';
part './text_field/input_format.dart';
part 'bottom_bar.dart';

part 'dash_line.dart';

Widget separatorLine({
  Color? color,
  double? indent,
  double? endIndent,
}) =>
    Container(
      height: 0.5,
      color: color ?? ITheme.borderColor,
      margin: EdgeInsets.only(left: indent ?? 0, right: endIndent ?? 0),
    );

class KeepAlivePage extends StatefulWidget {
  const KeepAlivePage({
    Key? key,
    required this.child,
  }) : super(key: key);
  final Widget child;
  @override
  State<KeepAlivePage> createState() => _KeepAlivePageState();
}

class _KeepAlivePageState extends State<KeepAlivePage>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return widget.child;
  }

  @override
  bool get wantKeepAlive => true;
}
